<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<html>
<head>
    <meta charset="utf-8">
    <title>student_update_search</title>
    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</head>
<body>
<br>
<br><br>
<div class="ui four column centered grid">
    <div class="column">
        <form action="/student_update_search" class="ui form" method="post">
            <div class="field">
                <label>用户名</label>
                <input name="name" th:value="${student.name}" type="text">
                <input name="id" th:value="${student.id}" type="hidden">
                <input name="keyword" th:value="${keyword}" type="hidden">
            </div>
            <div class="field">
                <label>密码</label>
                <input name="password" th:value="${student.password}" type="text">
            </div>
            <div class="field">
                <label>性别</label>
                <div th:if="${student.sex eq 'M'}">
                    <input checked="checked" name="sex" type="radio" value="M">M
                    <input name="sex" type="radio" value="F">F
                </div>
                <div th:if="${student.sex eq 'F'}">
                    <input name="sex" type="radio" value="M">M
                    <input checked="checked" name="sex" type="radio" value="F">F
                </div>
            </div>
            <div class="field">
                <label>年龄</label>
                <input name="age" th:value="${student.age}" type="number">
            </div>
            <div class="field">
                <label>班级</label>
                <div class="ui radio checkbox" th:each="major,it:${majors}">
                    <input name="major" th:unless="${major.id eq majorID}" th:value="${major.id}" type="radio">
                    <input checked="checked" name="major" th:if="${major.id eq majorID}" th:value="${major.id}"
                           type="radio">
                    <label th:text="${major.name}">单选选择</label>
                </div>
            </div>
            <button class="ui blue button" type="submit">提交</button>
            <a class="ui red button" th:href="@{/student_search(keyword=${keyword})}">返回</a>
        </form>
    </div>
</div>
</body>
</html>
